/**
 * Created by LuoWei on 2017-08-29.
 */
function submitdata() {
    var period = document.getElementById("period").value;
    var execution_time =document.getElementById("execution_time").value;
    var perform_number = document.getElementById("perform_number").value;
    var json=[{period:period,execution_time:execution_time,perform_number:perform_number}];
    ls=JSON.stringify(json)
    return ls
}

function submit() {
    var values=submitdata()
    var url='/setting-req?value='+values;
    loadajx(values,url)
}

function loadajx(values,url) {
    var xmlhttp;
    if (values=="")
    {
        showhide_all();
        obj=document.getElementById('msg_txt');
        obj.innerHTML='请求参数为空';
        return;
    }
    if (window.XMLHttpRequest)
    {// code for IE7+, Firefox, Chrome, Opera, Safari
    xmlhttp=new XMLHttpRequest();
    }
    else
    {// code for IE6, IE5
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlhttp.onreadystatechange=function()
    {
    if (xmlhttp.readyState==4 && xmlhttp.status==200)
        {
            showhide_all();
            obj=document.getElementById('msg_txt');
            obj.innerHTML=xmlhttp.responseText;
        }
    }
    xmlhttp.open("POST",url,true);
    xmlhttp.send(values);
    }


    function colshide_all() {
        var obj=document.getElementById('hidden-div-mian');
        var obje=document.getElementById('hidden-div');
        obje.style.display= 'none';
        obj.style.display= 'none';
        }

    function showhide_all() {
        var obj=document.getElementById('hidden-div-mian');
        var obje=document.getElementById('hidden-div');
        obje.style.display="block"
        obj.style.display="block"
        }

